<?php $this->load->view('header'); ?>
<?php
if ($msg = $this->session->flashdata('flash_message')) {
   //showMessage($msg['type'], $msg['msg']);
?>
    <script type="text/javascript">
        $.notify(
            "<?php echo $msg['msg']?>", 
            { 
               position:"top center",
                showAnimation: 'slideDown',
                autoHideDelay: 2000,
                className: 'success',
                hideAnimation: 'slideUp',
                autoHide: true,
                autoHideDelay: 3000
            }
        );
    </script>
<?php
}
?>

<div class="wrap-detail-project wrap-dashboard">
    <div class="container container-dashboard">
        <div class="row">
            <div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 no-padding">
                <ul class="tab-dashboard">
                    <li class="active"><a href=""><?php echo $this->lang->line("Hire")?></a></li>
                    <li><a href=""><?php echo $this->lang->line("Manage")?></a></li>
                    <li><a href="<?php echo url_buyerEditProfile()?>"><?php echo $this->lang->line("Setting")?></a></li>
                </ul>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 no-padding">
                <div class="search-dashboard">
                    <form action="" method="post" id="frm-search">
                        <select name="search_type" class="search-type">
                            <option><?php echo $this->lang->line('Freelancers')?></option>
                            <option><?php echo $this->lang->line('Jobs')?></option>
                        </select>
                        <input type="text" name="search" class="search" placeholder="<?php echo $this->lang->line('Find freelancers');?>">
                        <button type="submit" class="btn-search glyphicon glyphicon-search"></button>
                    </form>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding">
                <ul class="nav nav-pills tab-child">
                    <li><a href="<?php echo site_url('buyer/viewMyProjects');?>"><?php echo $this->lang->line("My jobs")?></a></li>
                    <li class="active"><a href="<?php echo site_url('buyer/savedFreelancers');?>"><?php echo $this->lang->line("Saved freelancers")?></a></li>
                    <li><a href="<?php echo site_url('buyer/messages');?>"><?php echo $this->lang->line("Messages")?></a></li>
                    <li><a href=""><?php echo $this->lang->line("All updates")?></a></li>
                </ul>
            </div>
        </div>
        <div class="row app-panel">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding">
                <?php $count_freelancer = $listFreelancer->num_rows(); ?>
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding saved-app-title"><?php echo $this->lang->line('Saved Freelancers').' (<span>'.$count_freelancer.'</span>)'?></div>
                <?php
                if($count_freelancer > 0){
                    foreach($listFreelancer->result() as $item){
                        ?>
                        <div class="info-find-freelancer col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding item-<?php echo $item->id?>">
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 no-padding">
                                <a href="<?php echo site_url('programmer/viewProfile/'.$item->id);?>" />
                                <img src="<?php
                                if ( (is_file_exists($item->logo) == TRUE ) && ($item->logo != "")) echo uimage_url($item->logo); else echo image_default();
                                ?>" class="img-responsive" />
                                </a>
                            </div>
                            <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 padding-left">
                                <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12 no-padding" data-id="<?php echo $item->id?>">
                                    <a href="<?php echo site_url('programmer/viewProfile/'.$item->id);?>" /><?php echo $item->user_name?></a>
                                    <span class="btn-remove-watchlist glyphicon glyphicon-heart"  data-id="<?php echo $item->id;?>"></span>
                                    <a href="<?php echo site_url('project/contactFreelancer/'.$item->id)?>" class="btn btn-contact-freelancer"><?php echo $this->lang->line('Contact');?></a>
                                </div>
                                <div style="margin-bottom: 0px;" class="col-md-12 col-lg-12 col-xs-12 col-sm-12 no-padding short-desc">
                                    <?php echo cutString($item->profile_desc, 200, "...")?>
                                </div>
                                <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12 no-padding full-desc" style="display: none">
                                    <?php echo $item->profile_desc;?>
                                </div>
                                <?php
                                if(strlen($item->profile_desc) > 200){
                                    ?>
                                    <span style="cursor: pointer"  class="more-desc green-2 col-md-12 col-lg-12 col-xs-12 col-sm-12 no-padding">
                                    more
                                    </span>
                                <?php } ?>
                                <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12 no-padding">
                                    <span class="col-md-3 col-lg-1 col-xs-3 col-sm-3 no-padding">Skills: </span>
                                    <div class="list-skill col-md-9 col-lg-11 col-xs-9 col-sm-9 no-padding">
                                        <ul style="margin-bottom: 0px;">
                                            <?php echo getCategoryLinks2($item->user_categories);?>
                                        </ul>
                                    </div>
                                </div>
                                <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12 no-padding list-dev-info">
                                    <ul class="listDevExt">
                                        <li>
                                            <span class="glyphicon glyphicon-map-marker"></span>
                                            <?php echo $item->country_name;?>
                                        </li>
                                        <li>
                                            <input  value="<?php echo $item->user_rating?>" type="number" data-star-captions="{}" data-default-caption="{rating}" class="rating" min=0 max=5  data-size="xs" disabled="disabled">
                                        </li>
                                        <li>
                                            <?php echo $item->num_project.' '. $this->lang->line('jobs'); ?>
                                        </li>
                                        <li>
                                            $208,252 Earned
                                        </li>
                                        <li>
                                            <a class="btn-remove-watchlist" data-id="<?php echo $item->id;?>"><?php echo $this->lang->line('Remove');?></a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div> <!-- info-find-freelancer -->
                    <?php }  } else{
                    echo '<div class="row-find-job col-lg-12 col-md-12 col-sm-12 col-xs-12">';
                    echo $this->lang->line('No Results');
                    echo '</div>';
                }?>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('footer'); ?>